package com.by.hellosecurityoauth2.service;

import com.by.hellosecurityoauth2.controller.request.RoleRequestBean;
import com.by.hellosecurityoauth2.controller.request.UserRoleRequestBean;
import com.by.hellosecurityoauth2.domain.TAuthority;
import com.by.hellosecurityoauth2.domain.TUser;
import com.by.hellosecurityoauth2.domain.TUserRole;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * @author 白羽
 * @Date 2022-12-03 21:26:00
 */
public interface UserService {


    /**
     * 查询多条数据
     *
     * @param page 查询起始位置
     * @param limit 查询条数
     * @return 对象列表
     */
    Page<TUser> list(int page, int limit);

    TUser findByUsername(String username);

    TUser findById(Long id);

    TUser create(RoleRequestBean bean);

    TUser updateById(Long id, RoleRequestBean bean);

    void deleteById(Long id);

    List<TUserRole> updateUserRole(Long id, List<UserRoleRequestBean> bean);

    List<TAuthority> getUserAuthorities(TUser user);

    List<TUserRole> getUserRoleByUserId(Long id);

}